<!-- =========== 文章【发布】页面 =========== -->
<!-- ArticlePublishPage -->
<!-- article_publish_page -->

<!-- 
  功能 ： 发布 addArticleRequest
-->
<script lang="ts" setup>
import { addArticleRequest } from '@/api/manage_request'
import { reactive } from 'vue'

const article = reactive({
  title: '',
  content: '',
  status: false
})

async function add() {
  if (!article.title || !article.content) return alert('请填写完整')
  const r = await addArticleRequest(article)
  console.log(r)
}

function reset() {
  article.title = ''
  article.content = ''
  article.status = false
}
</script>

<template>
  <div>文章==发布==页面</div>
  <div>
    <p>文章标题：<input type="text" v-model="article.title" /></p>
    <p>文章内容：<input type="text" v-model="article.content" /></p>
    <p>是否公开：<input type="checkbox" v-model="article.status" /></p>
    <p>
      <button @click="reset">重置</button>
      &nbsp;&nbsp;
      <button @click="add">发布</button>
    </p>
  </div>
</template>

<style lang="css" scoped></style>
